package com.hzp.day51.biz;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hzp.day51.dao.EmployeeMapper;
import com.hzp.day51.model.Employee;



/**
 * @author hzp
 *
 */
@Service
public class EmployeeBiz {
	@Resource
	private EmployeeMapper employeeMapper;
	
	public void save(Employee emp){
		employeeMapper.insert(emp);
	}
	public void saveSelect(Employee emp){
		employeeMapper.insertSelective(emp);
	}
	public void updateSelect(Employee emp){
		employeeMapper.updateByPrimaryKeySelective(emp);
	}
	public void update(Employee emp){
		employeeMapper.updateByPrimaryKey(emp);
	}
	public void delete(int empId){
		employeeMapper.deleteByPrimaryKey(empId);
	}
	public List<Employee> findAll(){
		return employeeMapper.selectAll();
	}
	public Employee findById(int id){
		return employeeMapper.selectByPrimaryKey(id);
	}
}
